<!DOCTYPE html>
<html lang='zh-CN'>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>黑珍珠记录表</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/materialdesignicons.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.min.css" rel="stylesheet">
    <link href="js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header"><h4>黑珍珠记录</h4></div>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade active in" id="home">

                        <form class="form-inline" method="post" id="searchForm">
                            <div class="form-group">
                                <label>会员账号:</label>
                                <input type="text" class="form-control" name="memberId">
                            </div>
                            <div class="form-group">
                                <label>创建时间:</label>
                                <input type="text" class="form-control js-datepicker" data-date-format="yyyy-mm-dd" name="startTime" placeholder="开始时间" style="width:120px;"> -
                                <input type="text" class="form-control js-datepicker" data-date-format="yyyy-mm-dd" name="endTime" placeholder="结束时间" style="width:120px;">
                            </div>
                            <div class="form-group">
                                <label>消费或者充值:</label>
                                <select name="sign" class="form-control">
                                    <option value="">全部</option>
                                    <option value="-">消费</option>
                                    <option value="+">充值</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <button class="btn btn-info btn_query btn-round"  type="button" id="searchFormBtn" >查询</button>
                            </div>
                        </form>
                        <table id="address_data"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>




<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-table/bootstrap-table.js"></script>
<script type="text/javascript" src="js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="js/zero2one/zero2one.version.js"></script>
<script type="text/javascript" src="js/zero2one/zero2one.core.js"></script>
<script type="text/javascript" src="js/dropzone/min/dropzone.min.js"></script>
<script type="text/javascript" src="js/bootstrapvalidator/dist/js/bootstrapValidator.js"></script>
<!-- bootstrap表单验证插件 -->
<script type="text/javascript" src="js/bootstrap-validator-master/dist/validator.js"></script>
<!-- jquery-form表单提交插件 -->
<script type="text/javascript" src="js/jquery-form/jquery.form.js"></script>
<!-- bootstrap弹出框插件 -->
<script type="text/javascript" src="js/jquery.bootstrap.min.js"></script>
<!-- 表单填充插件 -->
<script type="text/javascript" src="js/jquery-form/jquery.formloader.js"></script>
<!--日期选择插件-->
<script src="js/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>


<script type="text/javascript">

    //设置表头
    var columns = [
        {checkbox: true},
        {field: 'id',title: 'ID',visible:false},
        {field: 'memberId',title: '会员账号'},
        {field: 'price',title: '金额'},
        {field: 'typeState',title: '类型'},
        // {field: 'typeState',title: '类型',formatter: function (value, row, index) {
        //        if(value=='1'){
        //             return "<button class=\"btn btn-warning btn-sm\">购物</button>";
        //         }else if(value=='2'){
        //             return  "<button class=\"btn btn-warning btn-sm\">确认收货</button>";
        //         }else if(value=='3'){
        //             return "<button class=\"btn btn-success btn-sm\">订单超时</button>";
        //         }else if(value=='4'){
        //             return  "<button class=\"btn btn-danger btn-sm\">订单取消</button>";
        //         }else if(value=='5'){
        //             return  "<button class=\"btn btn-primary btn-sm\">签到领金劵</button>";
        //         }else if(value=='6'){
        //             return "<button class=\"btn btn-warning btn-sm\">退款中</button>";
        //         }else if(value=='7'){
        //             return "<button class=\"btn btn-success btn-sm\">退款成功</button>";
        //         }else if(value=='8'){
        //             return "<button class=\"btn btn-danger btn-sm\">退款失败</button>";
        //         }else if(value=='9'){
        //             return "<button class=\"btn btn-danger btn-sm\">关闭交易</button>";
        //         }
        //     }},
        {field: 'creationTime',title: '创建时间', formatter: function (value) {
                return zero2one.dateFormat(value, 'Y-m-d H:i:s')
            }},

        {field: 'sign',title: '消费或者充值',formatter: function (value, row, index) {
                if (value=='+') {
                    return "<button class=\"btn btn-success btn-sm\">&nbsp;+&nbsp;</button>";
                }else if(value=='-'){
                    return "<button class=\"btn btn-warning btn-sm\">&nbsp;─&nbsp;</button>";
                }
            }},
        {field: 'balance',title: '余额'},
        {field: 'remark',title: '备注'}

    ];


    //进入主界面加载数据
    zero2one.datagrid("address_data", "/remote/blackpearlLog/list",function (params) {
        return $.extend(zero2one.tableInitParam(params), zero2one.form2json("searchForm"));
    }, columns);

    //点击查询按钮重新加载页面数据
    $("#searchFormBtn").click(function () {
        $('#address_data').bootstrapTable('refresh');
    });


</script>
</div>
</body>
</html>
